/****************************************************
          File Name:12-4.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Fri 26 Dec 2014 03:39:02 PM CST
*****************************************************/

#include"12-4.h"

int main()
{
    using std::cin;
    using std::cout;
    using std::endl;

    Stack mine(5);
    Stack another(mine);
    Item tmp;

    while(!mine.isfull())
    {
        cout << "Enter a number to push into stack: ";
        cin >> tmp;
        mine.push(tmp);
    }
    while(!another.isfull())
    {
        cout << "Enter a number to push into another stack: ";
        cin >> tmp;
        another.push(tmp);
    }
    cout << "now pop the number from stack: \n";
    while(!mine.isempty())
    {
        mine.pop(tmp);
        cout << tmp << endl;
    }
    cout << "-------------\n";
    while(!another.isempty())
    {
        another.pop(tmp);
        cout << tmp << endl;
    }
    cout << "+++++++++++++\n";
    cout << "Now assign mine to another and then pop it:\n ";
    another = mine;
    cout << "*************\n";
    while(!another.isempty())
    {
        another.pop(tmp);
        cout << tmp << endl;
    }

    return 0;
}
